/// <reference types="webpack/module" />

import * as _ from 'lodash';
// import './assets/font-awesome-4.7.0/css/font-awesome.min.css';
import './style.css';
import './test.js';
import image from "./assets/global.png";

function component() {
  const element = document.createElement('div');

  element.innerHTML = _.join(['Hello', 'webpack'], '!');

  const img = new Image();
  img.src = image;
  element.appendChild(img)

  return element;
}

document.body.appendChild(component());

// 魔法命名
const worker = new Worker(/* webpackChunkName: "deepThougth" */new URL('./deep-thought.ts', import.meta.url));
worker.postMessage({
  question:
    'The Answer to the Ultimate Question of Life, The Universe, and Everything.',
});
worker.onmessage = ({ data: { answer } }) => {
  console.log(answer);
};